<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var num1=10;
        var num2=20;
        num1<num2 ? console.log("成功") : console.log("失败")
    </script>
</body>
</html>